﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BlogAppExt.Models
{
    /// <summary>
    /// Singleton class used for temporary data storage and generating seed data
    /// </summary>
    public sealed class Singleton
    {
        private static readonly Singleton instance = new Singleton();

        /// <summary>
        /// List of Users, BlogPosts, and BlogComments
        /// </summary>
        public List<User> Users { get; set; }
        public List<BlogPost> BlogPosts { get; set; }
        public List<CommentPost> BlogComments { get; set; }

        static Singleton() { }

        private Singleton()
        {
            //Generate seed data
            Users = new List<User>()
            {
                new User("ReeferGuy","Willy","Nelson","https://www.vipseats.com/images/willie%20nelson%20tickets.jpg"),
                new User("JLew","Jenny","Lewis","http://www.northerntransmissions.com/wp-content/uploads/2014/06/jennylewis01.jpg"),
                new User("ZDoe","Zooey","Deschanel","http://zooey-deschanel.net/updates/wp-content/uploads/2013/04/zooey-deschanel-435.jpg"),
                new User("RegSpek","Regina","Spektor","http://www.myjewishlearning.com/blog/wp-content/uploads/rspektor.jpg"),
                new User("TheDawk","Richard","Dawkins","http://devoutnone.com/wp-content/uploads/2014/03/richard-dawkins.jpg"),
                new User("ThommyBoy","Thom","Yorke","http://www.daysofthecrazy-wild.com/wp-content/uploads/2013/10/yorke.jpg"),
                new User("SpamTackular","Fake","Name","http://upload.wikimedia.org/wikipedia/en/a/a6/Bender_Rodriguez.png"),
                new User("MWard","Matthew","Ward","https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-xaf1/t1.0-9/10448763_10152561007409573_2611451269221972499_n.jpg"),
                new User("BobLoblaw","Bob","Loblaw","http://img3.wikia.nocookie.net/__cb20121117203508/arresteddevelopment/images/e/e6/3x3_Bob_Loblaw.png")
            };

            BlogPosts = new List<BlogPost>()
            {
                new BlogPost(0, "Rocky Mountain High","Aloha, my fellow islanders. Well, sorry to break the news, but in light of recent events, I will be packing my bags and heading out in search of that Rocky Mountain High I've heard so much about. I wish you all the best."),
                new BlogPost(1, "The Voyager","Hey Everyone. Check out my new album, The Voyager. I had so much fun making it and hanging out with my favorite ladies."),
                new BlogPost(2, "Classics","Matt and I are really looking forward to the release of our new album, Classics. We've had so much fun putting it together and hope you all enjoy it. Look for the release later this year!"),
                new BlogPost(3, "New Piano","I just had my brand new piano loaded into my loft here in New York. It plays beautifully and I can't wait to dig in and write some music."),
                new BlogPost(4, "My Genes are so Selfish", "My genes don't really care about me. All they care about is self-replication. Once that task has been accomplished, I'm basically disposable. Hopefully they haven't figured that out yet."),
                new BlogPost(8,"Bob Loblaw Law Blog","Welcome to my law blog. I am Bob Loblaw, a qualified attorney working in the Los Angeles area. If you need help with any legal matters, please get in touch.")
                
            };

            BlogComments = new List<CommentPost>()
            {
                new CommentPost(2,7,"Yes, it was great fun putting it together with you, Zooey"),
                new CommentPost(2,2,"Can't wait for Volume 4!"),
                new CommentPost(0,6,"Wandering around the nets dropping heaping piles of spam!"),
                new CommentPost(0,6,"Wandering around the nets dropping heaping piles of spam!"),
                new CommentPost(2,6,"Wandering around the nets dropping heaping piles of spam!"),
                new CommentPost(2,6,"Wandering around the nets dropping heaping piles of spam!"),
                new CommentPost(3,6,"Wandering around the nets dropping heaping piles of spam!"),
                new CommentPost(3,6,"Wandering around the nets dropping heaping piles of spam!")
            };

        }
        public static Singleton Instance
        {
            get
            {
                return instance;
            }
        }
    }
}